package JUNHO.conjuntos;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class ArrayListClassificacao {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		//ORDENACAO DE ArrayList
		List l = new ArrayList();
		l.add("Roberto");
		l.add("Sersoft");
		l.add("Java");
		l.add("Roberto");
		System.out.println(l);
		Collections.sort(l);
		System.out.println(l);
		
		List ll = new ArrayList();
		ll.add(new Integer(10));
		ll.add(new Integer(9));
		ll.add(new Integer(11));
		ll.add(new Integer(7)+3);
		ll.add(8);
		System.out.println(ll);
		Collections.sort(ll);
		System.out.println(ll);
		
		ordenarArrayListComComparable();
	}

	private static void ordenarArrayListComComparable() {
		System.out.println("#######################");
		System.out.println("ORDENANDO UM ARRAY");
		System.out.println("#######################");
		List l = new ArrayList();
		l.add(new Controle(5, "LG"));
		l.add(new Controle(4,"SONY"));
		l.add(new Controle(new Integer(1),"BRITANIA"));
		l.add(new Controle(new Integer(2),"SONY"));
		System.out.println(l);
		Collections.sort(l);
		System.out.println(l);
		
	}

}
